FROM ubuntu:20.04

RUN sed -i "s/security.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list && \
    sed -i "s/archive.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list && \
    apt-get update && \
    apt-get upgrade && \
    apt-get install -y git wget && \
    wget https://golang.google.cn/dl/go1.16.15.linux-amd64.tar.gz && \
    tar -zxvf go1.16.15.linux-amd64.tar.gz -C /usr/local && \
    rm -rf go1.16.15.linux-amd64.tar.gz

ENV GO111MODULE on
ENV GOPROXY https://goproxy.cn,direct
ENV GOCACHE /tmp/.cache
ENV PATH $PATH:/usr/local/go/bin

WORKDIR /code
